#include "ClearTileAction.hpp"

ClearTileAction::ClearTileAction(unsigned short* tile, int layer, int tilex, int tiley){
    desc = "Cleared (" + StringHelper::itos(tilex) + "," + StringHelper::itos(tiley) + ")(" + StringHelper::itos(layer) + ")";
    target = tile;
    originalValue = *target;
    perform();
}

void ClearTileAction::perform(){
    *target = NO_SPRITE;
}

void ClearTileAction::undo(){
    *target = originalValue;
}